import { renderElement } from '../renderElement'
import Modal from './Modal'
import { ModalProps } from './types'

export const useModal = (options: ModalProps) => {
	renderElement(Modal, options)
}

export const api =
	(options: Record<string, any>) => (localOptions: ModalProps) => {
		useModal({
			...options,
			...localOptions
		})
	}
